﻿using System;
using Noea.TogSim.Model.Interfaces;

namespace Noea.TogSim.Model.Signal
{
    public class SimpleSignalControl
    {
        SimpleSignal _signal;
        public SimpleSignalControl(SimpleSignal s)
        {
            _signal = s;
        }
        public void ActOnSensor(ISensor sensor, ISensorEventArgs args)
        {
            if ((bool)args.NewValue)
            {
                _signal.SetStop();
            }
            else
            {
                _signal.SetGo();
            }
        }
    }
}
